<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Access-Control-Allow-Origin" charset="utf-8">
		<title>登录</title>
		<style>
			*{
				/* padding: 0;
				margin: 0; */
				list-style: none;
			}
			
		</style>
	</head>
	<body>

		<ul id="View_LogIn_Main">
			<li><input type="text" placeholder="账号" v-model="number" /></li>
			<li><input type="text" placeholder="密码" v-model="pwd" /></li>
			<li>
				<button @click="LogInBut">登录</button>
			</li>
		</ul>

		<script src="../javaScript/vue.js"></script>
		<script src="../javaScript/jquery-3.5.1.min.js"></script>
		<script>
			var View_LogIn_Main_Vue = new Vue({
				el: "#View_LogIn_Main",
				data: {
					number: "100001",
					pwd: "123456"
				},
				methods: {
					//登录
					LogInBut() {
						if (this.number == "" || this.pwd == "") {
							console.log("请输入账号密码");
						}
						var thisVue = this;
						$.get("https://localhost:44356/api/LogIn/UserLogIn", {
							Uid : thisVue.number,
							Pwd : thisVue.pwd
						}, function(data) {
							console.log(data)
							if(data.statusCode == 0){
								//登录成功
								localStorage.setItem("ArticleUserId", data.result);
								location = "./UserArticle.html"
							}
						})
					}
				}
			});
			$(function() {

			})
		</script>
	</body>
</html>
